#include "SettingsWidget.h"

namespace cagd
{
    SettingsWidget::SettingsWidget(QWidget *parent): QWidget(parent)
    {
        setupUi(this);

        connect(reset_to_original_view_button, SIGNAL(clicked()), this, SLOT(_reset_transformation_parameters()));
    }

    void SettingsWidget::_reset_transformation_parameters()
    {
        trans_x_spin_box->blockSignals(true);
        trans_y_spin_box->blockSignals(true);
        trans_z_spin_box->blockSignals(true);

        rotate_x_slider->blockSignals(true);
        rotate_y_slider->blockSignals(true);
        rotate_z_slider->blockSignals(true);

        zoom_spin_box->blockSignals(true);


        trans_x_spin_box->setValue(0.0);
        trans_y_spin_box->setValue(0.0);
        trans_z_spin_box->setValue(0.0);

        rotate_x_slider->setValue(0);
        rotate_y_slider->setValue(0);
        rotate_z_slider->setValue(0);

        zoom_spin_box->setValue(1.0);


        trans_x_spin_box->blockSignals(false);
        trans_y_spin_box->blockSignals(false);
        trans_z_spin_box->blockSignals(false);

        rotate_x_slider->blockSignals(false);
        rotate_y_slider->blockSignals(false);
        rotate_z_slider->blockSignals(false);

        zoom_spin_box->blockSignals(false);
    }
}
